package be.novelfaces.showcase.webdriver.pages;

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

import be.novelfaces.showcase.webdriver.pages.home.HomePage;
import be.novelfaces.showcase.webdriver.util.NFBy;
import be.novelfaces.webdriver.BaseComponent;

public class Header extends BaseComponent {

	@FindBy(id = NFBy.HEADER_FORM + "logoLink")
	private WebElement logoLink;
	private HeaderToolbar headerToolbar = new HeaderToolbar();

	public Header() {
		super(By.id("logo"));
	}
	
	public HomePage clickLogo() {
		logoLink.findElement(By.xpath("img")).click();
		return new HomePage().assertArrivedAt();
	}
	
	public HeaderToolbar getHeaderToolbar() {
		return headerToolbar;
	}

}
